﻿@model Wabo.Web.Areas.Manager.ViewModels.Module.ModuleListViewModel

@{
    ViewBag.Title = Messages.HeadingModuleList;
}
<div class="page-header">
    <h1>
        @Messages.HeadingModuleList
        @if( Model.CanWrite)
        {
            <a href="@Url.Action("Create","Module")" class="btn btn-primary pull-right">
                <i class="icon-white  icon-plus-sign"></i>@Messages.CreateNewModule
            </a>            
        }
    </h1>
        
</div>

<table class="table">
    <thead>
        <tr>
            <th>@MetadataMessages.DISP_Order</th>
            <th>@MetadataMessages.DISP_Name</th>
            <th>@MetadataMessages.DISP_Controller</th>
            <th></th>
        </tr>
    </thead>
    @foreach (var m in Model.Modules)
    {
        <tr>
            <td>
                #@m.order
            </td>
            <td>
                @if( Model.CanWrite )
                {
                    @Html.ActionLink(m.title,"Edit","Module",new {m.id},null)                
                }
                else
                {
                    @m.title
                }
            </td>
            <td>
                @m.controller
            </td>
            <td>
                @if( Model.CanDelete)
                {
                    <a href="@Url.Action("Delete","Module",new{m.id})" class="btn btn-mini btn-danger pull-right">
                        <i class="icon-white icon-remove"></i>@Messages.ButtonDelete
                    </a>                    
                }      
            </td>      
        </tr>
    }
</table>
